$.ajax({
    type:"post",
    url:url+'/user/mycontent.html?token='+token,
    async:false,
    data:{'token':token},
    dataType:'json',
    success:function(result){
        // console.log(result)
        if(result.status === "0001"){
        	var data=result.data;
        	if(data.icon != ""){
        		$(".icon").attr("src",data.icon);
        	}
        	$(".grade_name").html(data.grade_name);
        	$(".hcg_wa").html(data.hcg_wa);
        	$(".cash_wa").html(data.cash_wa);
        	$(".care_wa").html(data.care_wa);
        	$(".get_release").html(data.get_release);
        	$(".username").html(data.username);
        }else{
            isErr(result);
        }
    },
	error:function(){
		layer.msg("响应失败");
	}
})
//	上传头像
$(".imgg").on("click",function(){
	$("#file1").click();
})
$("input[type='file']").on("change",function(){
	doUpload();
})
//上传图片接口
function doUpload() {
 	var formData = new FormData($( "#form1")[0]);  
 	formData.append("token",token);
 	$.ajax({  
      	url: url+'/user/updicon.html?token='+token,
  		type: 'POST',  
        data: formData,
        async: false,  
        cache: false,  
        contentType: false,  
        processData: false, 
        dataType:"json",
        success: function (result) {
        	if(result.status == '0001'){
        		layer.msg(result.message);
	        	$(".imgg").attr("src",result.src);
	        }else{
	            isErr(result);
	        }
        },
		error:function(){
			layer.msg("响应失败");
		}
    });  
}

//获取签到信息和节点释放
$(".qd_sf").on("click",function(){
	var type=$(this).attr("data");
	if(type == "1"){
		var kk='/user/checksign.html';
	}else{
		var kk='/profile/hcgrelease.html';
	}
	$.ajax({
	    type:"post",
	    url:url+kk+'?token='+token,
	    async:false,
	    data:{'token':token},
	    dataType:'json',
	    success:function(result){
	        if(result.status === "0001"){
	        	$(".qd_jk").html(result.message);
	        	dialog('#d2');
	        }else{
	            isErr(result);
	        }
	    },
		error:function(){
			layer.msg("响应失败");
		}
	})
})
	
//	退出登录
	$(".logout_btn").on("click",function(){		
		if(type == '1'){
			localStorage.clear();
			location.href='app://logout2';
		}else{
			localStorage.clear();
			location.href='login.html';
		}
		
	})